﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/Jqbox.css" rel="stylesheet" type="text/css" />
    <link href="../css/jquery.loadmask.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="../js/ligerui.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.dialog.js" type="text/javascript"></script>
    <script src="../Js/conmon.js" type="text/javascript"></script>
    <script src="../Js/jquery.loadmask.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../js/Highcharts/highcharts.js"></script>
    <script type="text/javascript" src="../js/Highcharts/exporting.js"></script>
    <title>用户考试图表</title>

    <script type="text/javascript">
        var chart, examname, score, pass;

        $(document).ready(function () {

            pWind = parent.window.parent.window.getWindow();
            user = (pWind != null ? pWind.user : null);

            if (user == null) {
                showErrorTip("获取参数出错.");
                return;
            }


            $.getJSON('../WebServer/ExamRoom.ashx?Action=userchart', { userid: user.id }, function (data) {
                if (data.IsSuccess == 1) {
                    // begin
                    chart = new Highcharts.Chart({
                        chart: {
                            renderTo: 'container',
                            defaultSeriesType: 'column'
                        },
                        title: {
                            text: user.username +' 用户'
                        },
                        subtitle: {
						    text: '历史考试记录'
					    },
						xAxis: {
						    categories: data.Data.Examname,
						    labels: {
						        rotation: -45,
						        align: 'right',
						        style: {
						            font: 'normal 10px Verdana, sans-serif'
						        }
						    }
                        },
                        yAxis: [{
                            labels: {
                                formatter: function () {
                                    return this.value + '分 (合格)';
                                },
                                style: {
                                    color: '#89A54E'
                                }
                            },
                            title: {
                                text: '合格分',
                                style: {
                                    color: '#89A54E'
                                }
                            }
                        }],
                        tooltip: {
                            formatter: function () {
                                return this.x+(this.series.name == '考生得分'?' 考生得分: ':' 合格分: ')+this.y + '(分)';
                            }
                        },
                        legend: {
                            layout: 'vertical',
                            align: 'left',
                            x: 120,
                            verticalAlign: 'top',
                            y: 100,
                            floating: true,
                            backgroundColor: '#FFFFFF'
                        },
                        series: [{
                            name: '考生得分',
                            color: '#4572A7',
                            type: 'column',
                            data: data.Data.Score

                        },{
                            name: '合格分数',
                            color: '#89A54E',
                            type: 'spline',
                            data: data.Data.Pass
                        }]
                    });
                    // JSON end
                }
            });
        });
    </script>

</head>
<body>
    <div id="container" style="width: 700px; height: 350px; margin: 0 auto"></div>
</body>
</html>
